package com.dragon.mmochat.message;

import com.dragon.mmochat.MmochatConstant;
import com.dragon.mmochat.model.role.MmochatFriend;
import com.dragon.mmochat.model.role.MmochatPlayer;
import com.skymobi.buffer.SkymobiBuffer;
import com.skymobi.message.SkymobiProtocolMessage;

public class Mmochat_10_13S extends SkymobiProtocolMessage {
	private MmochatFriend enermy;
	MmochatPlayer me;

	public Mmochat_10_13S() {
		setMsgCode(MmochatConstant.MSGCODE_MMOCHAT_S_10_13);
	}

	@Override
	protected void encodeBody(SkymobiBuffer out) {
		out.putInt(enermy.getRoleId());
		out.putInt(enermy.getFriendListPrority());
		out.putUnsignedShort(enermy.getBmpId());
		if (enermy.isVip()) {
			out.put((byte) 1);
		} else {
			out.put((byte) 0);
		}
		out.put((byte) enermy.getFriendState(me));
		out.putPrefixedString(enermy.getName(), 1);
	}

	public void setEnermy(MmochatFriend enermy) {
		this.enermy = enermy;
	}

	public void setMe(MmochatPlayer me) {
		this.me = me;
	}

}
